package cn.edu.xjtu.competiton;

import java.util.Scanner;

/**
 * @author Hydrion-QLz
 * @date 2022-05-15 13:04
 * @description
 */
public class third {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] rect = new int[4];
        int[] circ = new int[3];

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < 4; j++) {
                rect[j] = sc.nextInt();
            }
            for (int j = 0; j < 3; j++) {
                circ[j] = sc.nextInt();
            }
            if (rect[0] - circ[0] <= -circ[2] && rect[2] - circ[0] >= circ[2] && rect[1] - circ[1] <= -circ[2] && rect[3] - circ[1] >= circ[2]) {
                System.out.println("Y");
            } else {
                System.out.println("N");
            }
        }
    }
}
